home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 13 / AMIGAplus Sonderheft 13 (1998)(ICP)(DE)[!].iso / rexx / checkdir.vzrx < prev    next >
Text File  |  1998-03-01  |  1KB  |  54 lines

  1. /*
  2.    $VER: CheckDir.vzrx 1.02 (28.2.98)
  3.          © 1995-98 by Georg Hörmann
  4.          Improvements by Ramiro Garcia
  5.  
  6.    Template: CheckDir.vzrx DIR/A,QUIT/S
  7.  
  8.       DIR:  Must be a valid path.
  9.       QUIT: If VirusZ has been started from the script, you can
  10.             quit after checking by specifying this option.
  11.  
  12.    If VirusZ is not running, it will be started from the
  13.    script (and quitted afterwards if requested).
  14. */
  15.  
  16. Prog_VirusZ = "dh0:VZ" /* You may change this */
  17.  
  18. options results
  19. options failat 99
  20.  
  21. UseQuitFlag = "no"
  22.  
  23. parse upper arg DirToCheck QuitFlag
  24. if DirToCheck = "" then do
  25.     say "No directory specified."
  26.     exit
  27.     end
  28.  
  29. if ~show(ports,VIRUSZ_II.REXX) then do
  30.     say "Starting VirusZ..."
  31.     address command Prog_VirusZ
  32.     UseQuitFlag = "yes"
  33.     StartTime = time(seconds)
  34.     do while ~show(ports,VIRUSZ_II.REXX)
  35.         if time(seconds) - StartTime > 20 then do
  36.             say "Error loading VirusZ!"
  37.             exit
  38.             end
  39.         end
  40.     end
  41.  
  42. address VIRUSZ_II.REXX CHECKDIR DirToCheck DECREXEC DECRDATA
  43.  
  44. if rc=0 then say "Directory '"DirToCheck"' is clean."
  45. if rc=5 then say "Directory '"DirToCheck"' contains virus!"
  46. if rc=10 then say "Error checking directory '"DirToCheck"'!"
  47.  
  48. if UseQuitFlag = "yes" then do
  49.     if QuitFlag = "QUIT" then do
  50.         say "Quitting VirusZ..."
  51.         address VIRUSZ_II.REXX QUIT
  52.         end
  53.     end
  54.